package com.example.exception;

/**
 * 异常枚举
 */
public enum ImoocMallExceptionEnum {
    NEED_USER_NAME(10001, "用户名不能为空"),
    NEED_PASSWORD(10002, "密码不能为空"),
    PASSWORD_TEST(10003, "密码长度不能少于8位"),
    NAME_EXISTED(10004, "用户名存在"),
    INSERT_FAILED(10005, "插入失败,请重试"),
    ERROR_PWD(10006,"密码错误"),
    NO_LOGIN_USER(10007,"请先登录！"),
    UPDATE_SIGNATURE(10008,"更新失败"),
    NO_ADMINISTRATOR(10009,"你不是管理员，无权登录"),
    CAN_NOT_NULL(10010,"参数不能为空"),
    No_MAGGER_ROLE(10011,"禁止非管理员操作"),
    SHOP_NAME_EXISTED(10013,"商品名存在"),
    ADD_FAILED(10012,"注册失败"),
    ADD_SUCCESS(10015,"注册成功"),
    NOEXIT_USER_NAME(10014, "用户名不能为空"),
    NO_EXIT_USER_NAME(10015, "用户名不存在"),
    NO_EXIT_USER(10016, "用户不存在"),
    ADD_PRODUCT(10017,"添加商品分类失败"),
    EXIT_PRODUCT(10018,"该商品分类名称已存在"),
    NOT_NULL_PRODUCT(10019,"商品分类名称不能为空"),
    REQUEST_ERROR(10020,"参数错误"),
    SHOP_ID(10021,"您当前选择的商品找不到了"),
    UPDATE_PRODUCT(10022,"更新商品分类失败"),
    NOT_NULL_ID(10023,"ID不能为空"),
    DELETE_SUCCESS(10024,"删除成功"),
    FILED_DELETE(10025,"删除失败"),
    NO_EXIT_SHOP(10026,"此商品分类名称不存在"),
    FAIL_MKDIR(10027,"新建文件夹失败"),
    UPLOAD_IMG(10028,"上传图片失败"),
    SYSTEM_ERROR(20000,"系统异常");



    /**
     * 异常码
     */

    /**
     * 异常信息
     */
    private Integer code;
    private String message;
    ImoocMallExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.message = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return message;
    }

    public void setMsg(String msg) {
        this.message = msg;
    }
}
